package com.jim.springjim.config;

import org.jim.core.ImChannelContext;
import org.jim.core.packets.ChatBody;
import org.jim.core.packets.LoginReqBody;
import org.jim.core.packets.LoginRespBody;
import org.jim.core.packets.User;
import org.jim.core.utils.JsonKit;
import org.jim.core.ws.WsRequestPacket;
import org.jim.server.demo.service.AbstactTransformHandler;
import org.springframework.stereotype.Component;

@Component
public class JimConfig extends AbstactTransformHandler {

    @Override
    public void doChatMessageProcessor(ChatBody chatBody, ImChannelContext imChannelContext) {
        System.out.println("我进来了" + JsonKit.toJSONString(chatBody));
        System.out.println("doChatMessageProcessor");
    }

    @Override
    public User getWebUser(LoginReqBody loginReqBody, ImChannelContext imChannelContext) {
        System.out.println("getWebUser");
        System.out.println(JsonKit.toJSONString(loginReqBody));
        return null;
    }

    @Override
    public LoginRespBody doWebLogin(LoginReqBody loginReqBody, ImChannelContext imChannelContext) {
        System.out.println("doWebLogin");
        System.out.println(JsonKit.toJSONString(loginReqBody));
        return null;
    }

    @Override
    public Boolean webLoginHake(WsRequestPacket request) {
        System.out.println("webLoginHake");
        System.out.println(JsonKit.toJSONString(request));
        return super.webLoginHake(request);
    }
}
